Skip to content

Conversation

@cmp0xff
Copy link
Contributor

@cmp0xff cmp0xff commented Oct 23, 2025

*.pyi

  • Now we comply to ANN206, ANN401, PLC0105
  • ANN401 is permanently ignored

tests/*

  • Now we comply to all ANN except for ANN401
  • ANN401 and ARG are permanently ignored

Known issue

tests/extension/decimal/array.py is a bit ugly now, hopefully it's okay. We can improve when we do typing for the arrays.

@cmp0xff cmp0xff marked this pull request as ready for review October 23, 2025 14:45
@cmp0xff cmp0xff changed the title feat(ruff): comply to ANN206, ANN401, PLC0105, etc. feat(ruff): comply to ANN206, PLC0105, etc. Oct 23, 2025
@cmp0xff cmp0xff changed the title feat(ruff): comply to ANN206, PLC0105, etc. refactor(ruff): comply to ANN206, PLC0105, etc. Oct 23, 2025
Copy link
Member

@loicdiridollou loicdiridollou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really convinced about the value of forcing ANN on the tests files but fine since you already did the work.
@Dr-Irv let me know if you are onboard with the change of name for S2_CT to S2_contra and I will merge after.

@cmp0xff
Copy link
Contributor Author

cmp0xff commented Oct 25, 2025

Not really convinced about the value of forcing ANN on the tests files

The idea originated from #1405 (review). ANN on the test files contributes to complying to pyright strict.

@loicdiridollou loicdiridollou merged commit 5e16b86 into pandas-dev:main Oct 25, 2025
13 checks passed
@loicdiridollou
Copy link
Member

Thanks @cmp0xff

@cmp0xff cmp0xff deleted the feature/ruff-ann branch October 25, 2025 13:58
return super().astype(dtype, copy=copy)

def __setitem__(self, key, value) -> None:
def __setitem__(self, key: object, value: decimal._DecimalNew) -> None:
Copy link
Collaborator

@Dr-Irv Dr-Irv Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is incorrect. It could be decimal._DecimalNew or list[decimal._DecimalNew]

If you do that, I think the ignores can be removed, and, if not, you can add assert isinstance(value, list)

Or it might need to be another type of Sequence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ec57e21 it is hard, because Decimal can be constructed from both a scalar and from tuple[int, Sequence[int], int], which is an iterable itself.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment.

cmp0xff added a commit to cmp0xff/pandas-stubs that referenced this pull request Oct 25, 2025
loicdiridollou pushed a commit that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants